package com.tcl.aota.persistent.dao.db;

import java.util.List;
import java.util.Map;

import com.tcl.aota.persistent.model.AppLog;

public interface AppLogDAO {

    public AppLog selectByPrimaryKey(Long id);

    public int selectBetweenDate(Map<String, Object> conditions);

    public List<AppLog> selectAppIdBetweenDate(Map<String, Object> conditions);

    /**
     * insert appLog data
     *
     * @param appLog
     * @return
     */
    public int insertBath(List<AppLog> appLog) throws Exception;

    /**
     * 通过时间、AppName统计查询各个app的浏览量,下载量,安装量，更新量
     *
     * @param conditions
     * @return
     */
    public List<Map<String,Object>> selectAppGroupByAppIdBetweenDate(Map<String, Object> conditions);

    /**
     * count分组统计
     * @param conditions
     * @return
     */
    public int countAppGroupByAppIdBetweenDate(Map<String,Object> conditions);

    /**
     * get pageview,download,install,upgrad group by create_time
     * @param conditions
     * @return
     */
    public List<Map<String,Object>> selectAppGroupByDateBetweenDate(Map<String,Object> conditions);

    /**
     * count
     * @param conditions
     * @return
     */
    public int countAppGroupByDateBetweenDate(Map<String,Object> conditions);

    /**
     * get count group by status
     * @param condition
     * @return
     */
    public List<Map<String,Object>> selectGroupByStatusBetweenDate(Map<String,Object> condition);


    /**
     * get count distinct imei
     * @param condition
     * @return
     */
    public List<Map<String,Object>> selectAppImeiNumGroupByDate(Map<String,Object> condition);

    /**
     * count by distinct imei stat
     * @param conition
     * @return
     */
    public int countAppImeiNumGroupByDate(Map<String,Object> conition);

}
